fix: show the vault group number instead of the description on the el… #144
+91
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Show the vault group number on the element page
Closes #125
For a vault, the element page showed the name of its element group under "Element group". For vaults that name is a long description (for example "Handspring, Yamashita, round-off with or without turn in 1st and/or 2nd flight phase"), not a short group name. The Elements list (#114) already shows "Group N" for a vault, so the element page now does the same, with the same rule.
Changes
src/lib/catalogOperations.ts: thecatalogItemquery also asks forelementGroup { id number }. Theidlets Apollo's cache recognise the same group across queries, which removes this query's part of the "Cache data may be lost when replacing the elementGroup field" warning.src/lib/catalog.ts:ElementDetailhaselementGroupNumber, set bytoElementDetail.src/lib/elementList.ts:groupLabelaccepts anything withisVault,elementGroupNameandelementGroupNumber, so the list and the element page use the same function. The rule itself is unchanged.src/components/elements/ElementMetadataCard.tsx: "Element group" showsgroupLabel(element): "Group N" for a vault, and the name of the group for an element. (Prettier also reformatted two lines of theElementValueBadgein this file.)docs/AI_USAGE.md: a new entry for this issue.Testing
ElementDetailPage.test.tsx: one for an element (shows the name of the group) and one for a vault (shows "Group 1" and not the description), with the real group of VT-1.22-a. Each fails on its own when the page shows the name for every item or "Group N" for every item.catalog.test.tschecks thattoElementDetailcarries the number along.tsc -b, ESLint, Prettier (on the changed files),npm run buildand all 202 frontend tests pass.Not in this PR
searchOperations.ts) still asks forelementGroupwithoutid, so the cache warning can still appear from the list.🤖 Generated with Claude Code